import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/components/Login'
import ContractInformation from '@/components/ContractInformation'
import AddContract from '@/components/AddContract'
import Manager from '@/components/Manager'
import UpdateContract from '@/components/UpdateContract'

Vue.use(VueRouter)

const routes = [
  {
    path: '/manager',
    name: '管理合同',
    show: true,
    redirect: 'contractInformation',
    component: Manager,
    children: [
      {
        path: '/contractInformation',
        name: '合同信息',
        show: true,
        component: ContractInformation
      },
      {
        path: '/addContract',
        name: '添加合同',
        show: true,
        component: AddContract
      }
    ]
  },
  {
    path: '/',
    name: 'home',
    show: false,
    component: Login
  },
  {
    path: '/update',
    name: 'update',
    show: false,
    component: UpdateContract
  }
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
